package training.oop.polymorphism;

import static org.junit.Assert.*;

import org.junit.Before;
import org.junit.Test;

public class PolyExampleChildTest {
	
	PolyExampleChild child;

	@Before
	public void setUp() throws Exception {
		child = new PolyExampleChild();
	}

	//@Test
	public void testSayHello() {
		child.sayHello();
		child.sayHello("Baiju", 17);
	}
	
	@Test
	public void testTypeCasting(){
		
		PolyExample poly =  new PolyExampleChild();
		poly.sayHello();
		poly.sayHello("Nisha", 14);
		
		
		child.someOtherMethod();
		
		
		//type casting example. this will not work in this scenario.
		
		PolyExampleChild child1 = (PolyExampleChild) new PolyExample();
		child1.sayHello();
	}

}
